/* NOTE: this list of root selectors is present in _root.css too, if you update
   one then don't forget the other */

/* stylelint-disable-next-line selector-disallowed-list  */
:where(.ag-root-wrapper, .ag-external, .ag-popup, .ag-dnd-ghost, .ag-chart),
:where(.ag-root-wrapper, .ag-external, .ag-popup, .ag-dnd-ghost, .ag-chart) :where([class^='ag-']) {
    box-sizing: border-box;

    &::after,
    &::before {
        box-sizing: border-box;
    }

    &:where(div, span, label):focus-visible {
        /* elements that are not normally focussable, but are made
               focussable by the grid, get an inset shadow since they are often
               right up against the edge of an overflow:hidden container that
               will crop a regular shadow  */
        outline: none;
        box-shadow: inset var(--ag-focus-shadow);

        &:where(.invalid) {
            box-shadow: inset var(--ag-focus-error-shadow);
        }
    }

    &:where(button) {
        color: inherit;
    }
}

/* This next block must be on its own because browsers that don't support
   ::-ms-clear will ignore the whole block if it is placed in the above block */

/* stylelint-disable-next-line selector-disallowed-list */
:where(.ag-root-wrapper, ag-external, .ag-popup, .ag-dnd-ghost, .ag-chart) :where([class^='ag-']) ::-ms-clear {
    display: none;
}
